from sqlalchemy import Column, ForeignKey, Sequence
from sqlalchemy.types import Integer, String
from __init__ import Base

class Variables(Base):

    __tablename__ = "variables"

    id = Column(Integer, Sequence('variable_id_seq'), primary_key=True)
    widgetid = Column(Integer, ForeignKey('widgets.id'))
    name = Column(String(50))
    variable = Column(String(50))

    def __init__(self, widgetid, name, variable):
        self.widgetid = widgetid
        self.name = name
        self.variable = variable

    def __repr__(self):
        return "<Varibles('%s', '%s', '%s')>" % (self.widgetid, self.name, self.variable)
